<h1 class="title-h1">绑定微信公众号 接收推送消息</h1>
<style>
    .qrcode {
        width: 200px;
        height: 200px;
        margin-bottom: 50px;
    }
</style>
<div class="layui-card-body">
    <div class="layui-tab">
        <h3>绑定二维码</h3>
        <img class="qrcode" src="/index/getqrcode?admin_id={$admin_id}&type=3" />
    </div>
    <h3>
        当前绑定人:
        {$data.name}</h3>
    <img src="{$data.avatar}" />
</div>
<script>
    layui.use(['http'], function () {
        var layer = layui.layer,
            http = layui.http,
            $ = layui.$;
        var si = setInterval(function () {
            $.post('/index/getwxlogin', {
                admin_id: '{$admin_id}'
            }, function (res) {
                if (res.code == 0) {
                    layer.msg('微信绑定成功', {
                        offset: '45px',
                        icon: 1,
                        time: 800,
                    }, function () {
                        window.location.reload()
                    })
                }
            })
        }, 1500)
    });
</script>